package com.slipper.sfts.order.front;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.common.util.StringUtil;
import com.slipper.sfts.api.order.bo.OrderBO;
import com.slipper.sfts.api.order.service.IOrderSv;
import com.slipper.sfts.order.service.OrderService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderSv implements IOrderSv {
    @Resource
    private OrderService orderService;

    @Override
    public Result<OrderBO> order(OrderBO bo) {
        if (StringUtil.isBlank(bo.getCode())) {
            return ResultUtil.failureResult("证券代码不能为空！");
        }
        return orderService.order(bo);
    }

    @Override
    public Result<?> cancel(OrderBO bo) {
        return orderService.cancel(bo);
    }

}
